<?php include "../../coresection/connection.php";?>
<?php include "../../coresection/checkSession.php";?>
<?php include "../../coresection/admin-product.php";?>
<?php include "../../coresection/order-list.php";?>
<?php include "../../function/sum_total.php";?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <?php include '../../modules/head.php'; ?>
</head>

<body>
<?php include '../../modules/topbar.php'; ?>


<div class="setup_area">


    <?php include '../../modules/sidebar-admin.php'; ?>

    <div class="header">
        <h1>统计信息</h1>

        <?php include '../../modules/header.php'; ?>

    </div>


    <div class="content_area dishes_box finance-box">

        <div class="dishes-function">
            <a href="detail-add.php" class="layui-btn" >入账</a>
            <a href="detail-statistic.php" class="layui-btn" >统计</a>
        </div>

<h3>最近7日账目统计</h3>
        <table class="layui-table">
            <colgroup>
                <col width="60">
                <col width="250">
                <col >
                <col >
                <col >

                <col >
                <col >
                <col width="300">

                <col>
            </colgroup>
            <thead>
            <tr>

                <th>序号</th>
                <th>日期</th>
                <th>金额</th>
            </tr>
            </thead>
            <tbody>


                <tr>
                    <td>1</td>
                    <td><?echo date("Y-m-d")?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d")."%' and status = '生效' ")?></td>
                </tr>

                <tr>
                    <td>2</td>
                    <td><?echo date("Y-m-d",strtotime("-1 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-1 day"))."%' and status = '生效' ")?></td>
                </tr>


                <tr>
                    <td>3</td>
                    <td><?echo date("Y-m-d",strtotime("-2 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-2 day"))."%' and status = '生效' ")?></td>
                </tr>
                <tr>
                    <td>4</td>
                    <td><?echo date("Y-m-d",strtotime("-3 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-3 day"))."%' and status = '生效' ")?></td>
                </tr>
                <tr>
                    <td>5</td>
                    <td><?echo date("Y-m-d",strtotime("-4 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-4 day"))."%' and status = '生效' ")?></td>
                </tr>
                <tr>
                    <td>6</td>
                    <td><?echo date("Y-m-d",strtotime("-5 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-5 day"))."%' and status = '生效' ")?></td>
                </tr>

                <tr>
                    <td>7</td>
                    <td><?echo date("Y-m-d",strtotime("-6 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-6 day"))."%' and status = '生效' ")?></td>
                </tr>


                <tr>
                    <td>8</td>
                    <td><?echo date("Y-m-d",strtotime("-7 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-7 day"))."%' and status = '生效' ")?></td>
                </tr>


                <tr>
                    <td>9</td>
                    <td><?echo date("Y-m-d",strtotime("-8 day"))?></td>
                    <td><?echo sum_total("finance","applydate like '".date("Y-m-d",strtotime("-8 day"))."%' and status = '生效' ")?></td>
                </tr>



            </tbody>
        </table>








        <h3>最近3月账目统计</h3>
        <table class="layui-table">
            <colgroup>
                <col width="60">
                <col width="250">
                <col >
                <col >
                <col >

                <col >
                <col >
                <col width="300">

                <col>
            </colgroup>
            <thead>
            <tr>

                <th>序号</th>
                <th>日期</th>
                <th>金额</th>
            </tr>
            </thead>
            <tbody>




            <tr>
                <td>2</td>
                <td><?echo date("Y-m")?></td>
                <td><?echo sum_total("finance","applydate like '".date("Y-m")."%' and status = '生效' ")?></td>
            </tr>

            <tr>
                <td>1</td>
                <td><?echo date("Y-m",strtotime("-1 month"))?></td>
                <td><?echo sum_total("finance","applydate like '".date("Y-m",strtotime("-1 month"))."%' and status = '生效' ")?></td>
            </tr>

            <tr>
                <td>3</td>
                <td><?echo date("Y-m",strtotime("-2 month"))?></td>
                <td><?echo sum_total("finance","applydate like '".date("Y-m",strtotime("-2 month"))."%' and status = '生效' ")?></td>
            </tr>

            <tr>
                <td>4</td>
                <td><?echo date("Y-m",strtotime("-3 month"))?></td>
                <td><?echo sum_total("finance","applydate like '".date("Y-m",strtotime("-3 month"))."%' and status = '生效' ")?></td>
            </tr>

            <tr>
                <td>5</td>
                <td><?echo date("Y-m",strtotime("-4 month"))?></td>
                <td><?echo sum_total("finance","applydate like '".date("Y-m",strtotime("-4 month"))."%' and status = '生效' ")?></td>
            </tr>

            </tbody>
        </table>



    </div>

    </div>


    <!--list-box end-->
</div>

<!--content端點01-->
</div>
<!--maincontent端點01-->
<br class="clearfloat"/>
</div>
<!--container端點01-->
</div>




<script>
    //Demo
    layui.use('form', function(){
        var form = layui.form();

        //监听提交
        form.on('submit(formDemo)', function(data){
            layer.msg(JSON.stringify(data.field));
            return false;
        });
    });
</script>



<!--删除box-->
<?php include '../modules/deletebar.php'; ?>
<!--删除box end-->

<?php include '../../modules/footer.php'; ?>
</body>
</html>
